package us.oh.k12.wkw.robot.command;

public class LauncherSpeedIncreaseCmd extends CommandWithTimeout {

	final double speed;

	public LauncherSpeedIncreaseCmd() {
		this(0.5, 0.1);
	}

	public LauncherSpeedIncreaseCmd(final double pSpeed) {
		this(0.5, pSpeed);
	}

	public LauncherSpeedIncreaseCmd(final double pTimeout, final double pSpeed) {
		super("LauncherSpeedIncrease", pTimeout);
		this.speed = pSpeed;
		this.requires(this.getLaunchFrisbeeSystem());
	}

	protected void execute() {

		try {

			this.debug("execute()", "Called.");
			this.getLaunchFrisbeeSystem().increaseMotor1Speed(this.speed);
			this.getLaunchFrisbeeSystem().increaseMotor2Speed(this.speed);

		} catch (Exception anEx) {
			this.error("execute()", anEx);
		}
	}

	protected boolean isFinished() {
		return true;
	}
}
